package com.zzyl.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zzyl.base.PageResponse;
import com.zzyl.mapper.NursingProjectMapper;
import com.zzyl.mapper.OrdersProjectMapper;
import com.zzyl.service.OrdersProjectService;
import com.zzyl.vo.NursingProjectVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrdersProjectServiceImpl implements OrdersProjectService {

    @Autowired
    private OrdersProjectMapper ordersProjectMapper;

    @Autowired
    private NursingProjectMapper nursingProjectMapper;

    /**
     * 分页查询护理项目列表
     * @param name
     * @param pageNum
     * @param pageSize
     * @param status
     * @return
     */
    @Override
    public PageResponse<NursingProjectVo> queryPageNursingProject(String name, Integer pageNum, Integer pageSize, Integer status) {
        PageHelper.startPage(pageNum,pageSize);
        Page<NursingProjectVo> page = nursingProjectMapper.selectPageNursing(name,status);
        return PageResponse.of(page,NursingProjectVo.class);
    }

    /**
     * 根据编号查询护理项目信息
     * @param id
     * @return
     */
    @Override
    public NursingProjectVo getNursingProjectById(Integer id) {
        return  nursingProjectMapper.selectNursingProjectById(id);
    }
}
